package com.orifine.orm.type;

import java.sql.Time;
import java.text.SimpleDateFormat;

import com.orifine.orm.Information;
import com.orifine.orm.Type;
import com.orifine.orm.information.TimeIncrementInfo;
import com.orifine.orm.model.ColumnModel;

public class TimeType extends Type {
	private Time value;
	private static final SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
	
	public TimeType(){
		
	}
	
	public TimeType(Time time){
		value = time;
	}
	
	@Override
	public String getScriptType(ColumnModel column) {
		return "TIME";
	}

	@Override
	public String getScriptValue(ColumnModel column) {
		return filterQuote(format.format(value));
	}

	@Override
	public Information getDefaultInfo(ColumnModel column) {
		return new TimeIncrementInfo();
	}
}
